import {RoleVo} from "@/api/sys/admin/role/types";

/**
 * 菜单table列表
 */
export type MenuVo = {
    id?: number | string; // 为string是因为为空字符串的时候
    name: string;
    type: number;
    path?: string;
    component?: string;
    perm?: string;
    sort?: number;
    icon?: string;
    redirect?: string;
    status?: number,
    remark?: string,
    children?: MenuVo[];
    parent: Partial<MenuVo>
    roles?: RoleVo[];
}

/**
 * 专门针对验证规则用的
 */
export type MenuVoRules = Omit<MenuVo, 'children' | 'parent' | 'roles'>

export type MenuQuery = {
    query: Partial<MenuVo>
}

/**
 * 为路由服务的菜单属性
 */
export type MenuForRouter = {
    path: string,
    name: string,
    component?: string,
    redirect?: string,
    children?: MenuForRouter[],
    meta: {
        hidden?: boolean,
        title?: string,
        icon?: string,
        roles?: string[]
        affix?: boolean,
        keepAlive?: boolean,
    }
}
